var express = require("express");
const ProfileController = require("../../controllers/ProfileController");
var ProfileRouter = express.Router();
const passport = require("passport");

// 新增
ProfileRouter.post(
  "/add",
  passport.authenticate("jwt", { session: false }),
  ProfileController.add
);
// 获取列表
ProfileRouter.get(
  "/list",
  passport.authenticate("jwt", { session: false }),
  ProfileController.getList
);
// 单条获取
ProfileRouter.get(
  "/:id",
  passport.authenticate("jwt", { session: false }),
  ProfileController.getByid
);
// 更新
ProfileRouter.post(
  "/edit/:id",
  passport.authenticate("jwt", { session: false }),
  ProfileController.upadte
);
ProfileRouter.delete(
  "/delete/:id",
  passport.authenticate("jwt", { session: false }),
  ProfileController.delete
);
module.exports = ProfileRouter;
